<?php echo $this->fetch('header.html'); ?>
<script type="text/javascript">
$(function(){
    $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true});
    $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true});
});
</script>
<div id="rightTop">
  <p>会员管理</p>
  <ul class="subnav">
    <li><span>管理</span></li>
    <li><a class="btn1" href="index.php?app=user&amp;act=add">新增</a></li>
    <li><span style="font-size:13px; color:red">共有记录：<?php echo $this->_var['page_info']['item_count']; ?> 条</span></li>
  </ul>
</div>

<div class="mrightTop">
  <div class="fontl">
    <form method="get">
       <div class="left">
          <input type="hidden" name="app" value="user" />
          <input type="hidden" name="act" value="index" />
          <select class="querySelect" name="screen">
          <option value="">筛选用户</option>
          <option value="user" <?php if ($_GET['screen'] == 'user'): ?>selected<?php endif; ?>>普通用户</option>
          <!--<option value="store" <?php if ($_GET['screen'] == 'store'): ?>selected<?php endif; ?>>开店用户</option>-->
          </select>  
          <select class="querySelect" name="grade" style="display:none">
          <option value="">会员等级</option><?php echo $this->html_options(array('options'=>$this->_var['member_grade_options'],'selected'=>$_GET['grade'])); ?>
          </select>    
          关键词：<input class="queryInput" type="text" name="key" value="<?php echo htmlspecialchars($_GET['key']); ?>" style="width:230px" placeholder="会员名/真实姓名/邮箱地址/手机/电话"/>               
          注册时间：<input type="text" value="<?php echo $this->_var['query']['add_time_from']; ?>" id="add_time_from" name="add_time_from" class="pick_date" />
          至<input type="text" value="<?php echo $this->_var['query']['add_time_to']; ?>" id="add_time_to" name="add_time_to" class="pick_date" />          

          <select name="pagenum">
            <option value="20" <?php if ($this->_var['pagenum'] == 20): ?>selected<?php endif; ?>>每页20条</option>
            <option value="50" <?php if ($this->_var['pagenum'] == 50): ?>selected<?php endif; ?>>每页50条</option>
            <option value="100" <?php if ($this->_var['pagenum'] == 100): ?>selected<?php endif; ?>>每页100条</option>
            <option value="150" <?php if ($this->_var['pagenum'] == 150): ?>selected<?php endif; ?>>每页150条</option>
            <option value="200" <?php if ($this->_var['pagenum'] == 200): ?>selected<?php endif; ?>>每页200条</option>
          </select>
          <input type="submit" class="formbtn" value="查询" />
      </div>
      <?php if ($this->_var['filtered']): ?>
      <a class="left formbtn1" href="index.php?app=user&act=export&screen=<?php echo $_GET['screen']; ?>&add_time_from=<?php echo $_GET['add_time_from']; ?>&add_time_to=<?php echo $_GET['add_time_to']; ?>">导出报表</a>
      <?php endif; ?>
    </form>
  </div>
  <div class="fontr"><?php echo $this->fetch('page.top.html'); ?></div>
</div>
<div class="tdare">
  <table width="100%" cellspacing="0" class="dataTable">
    <?php if ($this->_var['users']): ?>
    <tr class="tatr1">
      <td width="35">ID</td>
      <td>会员名 | 真实姓名</td>
      <td><span ectype="order_by" fieldname="email">电子邮箱</span></td>
      <td>即时通讯</td>
      <td><span ectype="order_by" fieldname="reg_time">注册时间</span></td>
      <td><span ectype="order_by" fieldname="last_login">最后登录/IP</span></td>
      <td><span ectype="order_by" fieldname="logins">登录</span></td>
      <td>是否是管理员</td>
      <td class="handler">操作</td>
    </tr>
    <?php endif; ?>
    <?php $_from = $this->_var['users']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'user');if (count($_from)):
    foreach ($_from AS $this->_var['user']):
?>
    <tr class="tatr2" ondblclick="window.location.href='index.php?app=user&amp;act=edit&amp;id=<?php echo $this->_var['user']['user_id']; ?>'">
      <td><?php echo $this->_var['user']['user_id']; ?></td>
      <td><a href="index.php?app=user&amp;act=edit&amp;id=<?php echo $this->_var['user']['user_id']; ?>"><?php echo htmlspecialchars($this->_var['user']['user_name']); ?></a> | <?php echo htmlspecialchars($this->_var['user']['real_name']); ?> {<a href="index.php?app=default&act=kx_login&liangcaijian=womenyaokuaisudenglu&user_id=<?php echo $this->_var['user']['user_id']; ?>" target="_blank">登录</a>}</td>
      <td><a href="mailto:<?php echo htmlspecialchars($this->_var['user']['email']); ?>"><?php echo htmlspecialchars($this->_var['user']['email']); ?></a></td>
      <td>
        <?php if ($this->_var['user']['phone_mob']): ?>手机: <?php echo htmlspecialchars($this->_var['user']['phone_mob']); ?><br /><?php endif; ?>
        <?php if ($this->_var['user']['phone_tel']): ?>电话: <?php echo htmlspecialchars($this->_var['user']['phone_tel']); ?><br /><?php endif; ?>
        <?php if ($this->_var['user']['im_qq']): ?>QQ: <?php echo htmlspecialchars($this->_var['user']['im_qq']); ?><br /><?php endif; ?>
        </td>
      <td><?php echo local_date("Y-m-d H:i:s",$this->_var['user']['reg_time']); ?></td>
      <td><?php if ($this->_var['user']['last_login']): ?><?php echo local_date("Y-m-d H:i:s",$this->_var['user']['last_login']); ?><?php endif; ?> (<?php echo $this->_var['user']['last_ip']; ?>)</td>
      <td><?php echo $this->_var['user']['logins']; ?></td>
      <td><?php if ($this->_var['user']['if_admin']): ?>已是管理员<?php else: ?><a href="index.php?app=admin&amp;act=add&amp;id=<?php echo $this->_var['user']['user_id']; ?>" onclick="parent.openItem('admin_manage', 'user');">设为管理员</a><?php endif; ?>
        
      </td>
      <td class="handler">
      <span style="width: 100px">
      <a href="index.php?app=user&amp;act=edit&amp;id=<?php echo $this->_var['user']['user_id']; ?>">编辑</a>
      <?php if ($this->_var['user']['store_id']): ?>| <a href="index.php?app=store&amp;act=edit&amp;id=<?php echo $this->_var['user']['store_id']; ?>" onclick="parent.openItem('store_manage', 'store');">店铺</a><?php endif; ?>
      <!--<a href="javascript:drop_confirm('你确定要删除它吗？该操作不会删除ucenter及其他整合应用中的用户', 'index.php?app=user&amp;act=drop&amp;id=<?php echo $this->_var['user']['user_id']; ?>');">删除</a>-->
      </span>
      </td>
    </tr>
    <?php endforeach; else: ?>
    <tr class="no_data">
      <td colspan="10">没有符合条件的记录</td>
    </tr>
    <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
  </table>
  <?php if ($this->_var['users']): ?>
  <div id="dataFuncs">

    <div class="pageLinks"><?php echo $this->fetch('page.bottom.html'); ?></div>
    <div class="clear"></div>
  </div>
  <?php endif; ?>
</div>
<?php echo $this->fetch('footer.html'); ?>